extends CanvasLayer

@onready var animation = $AnimationPlayer

func change_scene_to_file(path : String) -> void:
	animation.play("fade")
	await animation.animation_finished
	get_tree().change_scene_to_file(path)
	animation.play_backwards("fade")

func reload_current_scene() -> void:
	animation.play("fade")
	await animation.animation_finished
	get_tree().reload_current_scene()
	animation.play_backwards("fade")
